package com.cd.university.db.mapper;

import com.cd.university.db.pojo.ProjectTeam;
import com.cd.university.db.pojo.ProjectTeamKey;
import com.cd.university.db.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ProjectTeamMapper {
    int deleteByPrimaryKey(ProjectTeamKey key);

    int insert(ProjectTeam record);

    int insertSelective(ProjectTeam record);

    ProjectTeam selectByPrimaryKey(ProjectTeamKey key);

    int updateByPrimaryKeySelective(ProjectTeam record);

    int updateByPrimaryKey(ProjectTeam record);

    /**
     * 根据用户id搜索用户的所有项目
     * @param userId 用户id
     * @return 项目编号集合
     */
    public List<Integer> searchProjectIdByUserId(@Param("userId") Integer userId);

    /**
     * 通过项目id搜索所有的项目成员信息
     * @param projectId 项目id
     * @return 成员信息集合
     */
    public List<User> searchUsersByProjectId(@Param("projectId") Integer projectId);
}
